﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VoiceAI.VoiceResponse
{
    public enum PlayControlType
    {
        Play,
        Stop,
        Pause,
        Prev,
        Next,
        AddOffset,
        SetOffsetTo,
        PlayMode,
        FullScreen,
        PlayResource,
        Unknow
    }

    public enum PlayerType
    {
        Music,
        Video,
        News,
        Radio,
        Weixintingshu,
    }
    public enum PlayMode
    {
        SinglePlay = 0,
        OrderPlay = 1,
        LoopPlay = 2,
        RandomPlay = 3
    }
    public interface IPlayableResource
    {
    }

    public interface IMusicResource: IPlayableResource
    {
        IReadOnlyList<string> PlayIdList { get;}
    }

    public interface IRadioItem
    {
        string Source { get; }
        string Title { get; }
        string MediaUri { get; }
        string CoverUrl { get; set; }
        string Summary { get; }
        string PlayId { get; }
    }
    public enum PlaylistAction
    {
        ReplaceAll = 0,    /// Replacing playlist. So that the current playing resource should be dropped.
        EnqueueFront = 1,    /// Insert into the front of playlist, keep playing current resource.
        EnqueueBack = 2,    /// Insert into the end of playlist, keep playing current resource.
        ReplaceEnqueue = 3,    /// Keep playing current resource, and replacing detail info in playlist, trigger UI refresh.
        RefreshURL = 4,    /// Keep playing current resource, refreshing media URL in playlist.
        Remove = 6,    /// Removing those resouces in playlist, if current playing resource is removed, switch to next resource immediately.
    }
    public interface IRadioResource : IPlayableResource
    {
        IReadOnlyList<IRadioItem> RadioItemList { get; }
        bool HasMorePlayResource { get; }
        bool HasMorePlayResourceUp { get; }
        PlaylistAction PlaylistAction { get; }
    }
    public interface IVideoResource : IPlayableResource
    {
        string DirectorName { get; }
        string ActorName { get; }
        string Year { get; }
        string VideoTag { get; }
        string VideoChannel { get; }
        string PlayName { get; }
        string Season { get; }
        string Episode { get; }
        string Language { get; }
    }

    public interface IPlayControlResponseData : IResponseData
    {
        PlayControlType PlayControlType { get; }
        PlayerType PlayerType { get; }
        IPlayableResource PlayableResource { get; }
        int? ControlValue { get; }
        string PlayTittle { get; }
        object PlayStateAdditionalMessage { get; }
    }
}
